package controllers

import (
	"fmt"
	"net/http"
)

// PagesController 处理静态页面
type PagesController struct {
}

// Home 首页
func (*PagesController) Home(w http.ResponseWriter, r *http.Request) {

	_, _ = fmt.Fprint(w, "<h1>Hello 这里是goblog</h1>")
}

// About 关于我们的页面
func (*PagesController) About(w http.ResponseWriter, r *http.Request) {

	_, _ = fmt.Fprint(w, "此博客是用以记录编程笔记~~~~~~"+
		"<a href=\"mailto:348209423@qq.com\">fanzhaogui@qq.com</a>")

}

// NotFound 404 页面
func (*PagesController) NotFound(w http.ResponseWriter, r *http.Request) {

	w.WriteHeader(http.StatusNotFound)
	_, _ = fmt.Fprint(w, "<h1>404 not found</h1>")
}
